function initKeyboard(){
   if (document.addEventListener)
    {
       document.addEventListener("keyup",keyup,false);
    }
    else if (document.attachEvent)
    {
       document.attachEvent("onkeyup", keyup);
    }
    else
    {
       document.onkeyup= keyup;
    }
}

function keyup(e)
{
	if (!e) e= event;
	debug('keyup:   ' + e.keyCode);
   if(typeof(document.getElementById('stage').jsKey) == 'function')
	document.getElementById('stage').jsKey(e.keyCode);
   else
      return true;
    if (e.preventDefault) e.preventDefault();
	if (e.stopPropagation) e.stopPropagation();
	return false;
}